<template>
    <div>
        <el-table
            :data="table"
            v-loading="tableLoading"
            border stripe size="mini" style="width: 100%">
            <el-table-column
                align="center"
                prop="createdTime"
                label="录入时间"
                fixed
                width="150">
            </el-table-column>
            <el-table-column
                width="85"
                align="center"
                label="录入人"
                fixed
                prop="createdBy">
            </el-table-column>
            <el-table-column
                label="合同编号"
                prop="contractNo"
                align="center"
                fixed
                width="120">
            </el-table-column>
            <el-table-column
                width="120"
                align="center"
                fixed
                label="产品名称"
                prop="productName">
            </el-table-column>
            <el-table-column
                width="100"
                align="center"
                label="资产受让人"
                prop="customerName">
            </el-table-column>
            <el-table-column
                width="150"
                align="center"
                label="身份证号"
                prop="idCard">
            </el-table-column>
            <el-table-column
                width="100"
                label="生日"
                align="center"
                prop="birthday">
            </el-table-column>
            <el-table-column
                label="年龄"
                align="center"
                prop="age">
            </el-table-column>
            <el-table-column
                label="性别"
                prop="sex"
                align="center">
            </el-table-column>
            <el-table-column
                width="180"
                align="center"
                label="打款账号"
                prop="payBankCard">
            </el-table-column>
            <el-table-column
                width="180"
                align="center"
                label="收款账号"
                prop="receiveBankCard">
            </el-table-column>
            <el-table-column
                width="220"
                align="center"
                label="打款银行开户行"
                prop="payOpeningBank">
            </el-table-column>
            <el-table-column
                align="center"
                width="220"
                label="收款银行开户行"
                prop="receiveOpeningBank">
            </el-table-column>
            <el-table-column
                width="100"
                align="center"
                label="联系电话"
                prop="telPhone">
            </el-table-column>
            <el-table-column
                width="300"
                align="center"
                label="联系地址"
                prop="address">
            </el-table-column>
            <el-table-column
                align="center"
                label="付款方式"
                prop="investmentType">
            </el-table-column>
            <el-table-column
                width="100"
                align="center"
                label="资产转让总额"
                prop="totalAssets">
            </el-table-column>
            <el-table-column
                width="85"
                align="center"
                label="预期收益率(%)"
                prop="returnRate">
            </el-table-column>
            <el-table-column
                width="150"
                align="center"
                label="标准业务折标系数"
                prop="standardCoefficient">
            </el-table-column>
            <el-table-column
                width="95"
                align="center"
                label="服务人员"
                prop="salemanInfo.salemanName">
            </el-table-column>
            <el-table-column
                width="95"
                align="center"
                label="区"
                prop="salemanInfo.area">
            </el-table-column>
            <el-table-column
                width="95"
                align="center"
                label="部"
                prop="salemanInfo.part">
            </el-table-column>
            <el-table-column
                width="95"
                align="center"
                label="组"
                prop="salemanInfo.group">
            </el-table-column>
            <el-table-column
                align="center"
                width="70"
                label="新老客户"
                prop="customerType">
            </el-table-column>
            <el-table-column
                align="center"
                width="150"
                label="回执回销时间"
                prop="receiptSellBackTime">
            </el-table-column>
            <el-table-column
                align="center"
                width="150"
                label="银行到账金额"
                prop="bankEceivedAmount">
            </el-table-column>
            <el-table-column
                align="center"
                width="150"
                label="银行手续费"
                prop="bankFee">
            </el-table-column>
            <el-table-column
                align="center"
                width="150"
                label="银行到账日期"
                prop="bankReceivedDate">
            </el-table-column>
            <el-table-column
                align="center"
                width="150"
                label="财务审核时间"
                prop="financeCheckTime">
            </el-table-column> 
            <el-table-column
                align="center"
                width="150"
                label="驳回时间"
                prop="rejectionTime"
                >
            </el-table-column>
            <el-table-column
                width="200"
                align="center"
                label="驳回理由"
                prop="remark">
            </el-table-column>
            <el-table-column
                align="center"
                width="100"
                label="状态"
                prop="status">
            </el-table-column>
            <el-table-column
                fixed="right"
                align="center"
                label="操作"
                width="150">
                    <template slot-scope="scope">
                        <el-button style="padding: 3px 4px 3px 4px;margin: 2px" type="primary"
                            size="mini" @click="showEditEmpView(scope.row)">查看信息
                        </el-button>
                    </template>  
                
            </el-table-column>
        </el-table>
        <el-pagination
            background
            :page-size="pageSize"
            :current-page="currentPage"
            @current-change="currentChange"
            layout="prev, pager, next"
            :total="totalCount"
            style="margin:50px;">
        </el-pagination>   
    </div>
</template>
<script>
export default {
  name: "TableForm",
  props:{
      interfaces:String,
  },
  data() {
    return {
      table: [],
      tableLoading: false,
      currentPage: 1,
      pageSize: 2,
      totalCount: -1
    };
  },
  mounted: function() {
    var that=this;
    this.initData();
    this.bus.$on('tableReflash',function(){
        that.initData();
    })
  },
  methods: {
    initData:function(){
        this.requestTableInfo(this.currentPage,this.pageSize);
    },
    //列表当前页改变
    currentChange: function(currentChange) {
      this.currentPage = currentChange;
      this.requestTableInfo(this.currentPage, this.pageSize);
    },
    // 请求列表数据
    requestTableInfo: function(pageCount, pageSize) {
      var that = this;
      that.tableLoading = true;
      that
        .postRequest(this.interfaces, {
        //   contractNo: that.contractNo,
          pageIndex: pageCount,
          pageSize: pageSize
        })
        .then(resp => {
          that.tableLoading = false;
          if (resp && resp.data.status == 200) {
            that.table = resp.data.obj.rows;
            that.totalCount = resp.data.obj.total;
          }
        });
    },
    //列表当前页改变
    currentChange: function(currentChange) {
      this.currentPage = currentChange;
      this.requestTableInfo(this.currentPage,this.pageSize);
    },
    //查看信息
    showEditEmpView(item){
        this.bus.$emit('showdialog',item)
    }
    
  }
};
</script>
<style>
</style>

